#include <stdio.h>
#include <stdlib.h>

int arraySum(int *, int);

int main()
{
	int list[5] = {2,4,1,4,5};
	printf("sum:%d\n", arraySum(list, 5));
	return 0;
}

int arraySum(int * array, int n)
{
	int sum = 0;
	int i = 0; 
	for(i = 0; i<n; i++)
		sum += array[i];
	return sum;
}
